<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

\section[FloatOut]{Float bindings outwards (towards the top level)}

``Long-distance'' floating of bindings towards the top level.
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.Opt.FloatOut</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatOutwards"><span class="hs-identifier">floatOutwards</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Arity.html"><span class="hs-identifier">GHC.Core.Opt.Arity</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Arity.html#exprArity"><span class="hs-identifier">exprArity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Arity.html#etaExpand"><span class="hs-identifier">etaExpand</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html"><span class="hs-identifier">GHC.Core.Opt.Monad</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#FloatOutSwitches"><span class="hs-identifier">FloatOutSwitches</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier">dumpIfSet_dyn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier">DumpFormat</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idArity"><span class="hs-identifier">idArity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idType"><span class="hs-identifier">idType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#isDeadEndId"><span class="hs-identifier">isDeadEndId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>                           </span><span class="annot"><a href="GHC.Types.Id.html#isJoinId"><span class="hs-identifier">isJoinId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#isJoinId_maybe"><span class="hs-identifier">isJoinId_maybe</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html"><span class="hs-identifier">GHC.Core.Opt.SetLevels</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier">UniqSupply</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.html#"><span class="hs-identifier">Data.IntMap</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">M</span></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-38"></span><span class="hs-comment">{-
        -----------------
        Overall game plan
        -----------------

The Big Main Idea is:

        To float out sub-expressions that can thereby get outside
        a non-one-shot value lambda, and hence may be shared.


To achieve this we may need to do two things:

   a) Let-bind the sub-expression:

        f (g x)  ==&gt;  let lvl = f (g x) in lvl

      Now we can float the binding for 'lvl'.

   b) More than that, we may need to abstract wrt a type variable

        \x -&gt; ... /\a -&gt; let v = ...a... in ....

      Here the binding for v mentions 'a' but not 'x'.  So we
      abstract wrt 'a', to give this binding for 'v':

            vp = /\a -&gt; ...a...
            v  = vp a

      Now the binding for vp can float out unimpeded.
      I can't remember why this case seemed important enough to
      deal with, but I certainly found cases where important floats
      didn't happen if we did not abstract wrt tyvars.

With this in mind we can also achieve another goal: lambda lifting.
We can make an arbitrary (function) binding float to top level by
abstracting wrt *all* local variables, not just type variables, leaving
a binding that can be floated right to top level.  Whether or not this
happens is controlled by a flag.


Random comments
~~~~~~~~~~~~~~~

At the moment we never float a binding out to between two adjacent
lambdas.  For example:

@
        \x y -&gt; let t = x+x in ...
===&gt;
        \x -&gt; let t = x+x in \y -&gt; ...
@
Reason: this is less efficient in the case where the original lambda
is never partially applied.

But there's a case I've seen where this might not be true.  Consider:
@
elEm2 x ys
  = elem' x ys
  where
    elem' _ []  = False
    elem' x (y:ys)      = x==y || elem' x ys
@
It turns out that this generates a subexpression of the form
@
        \deq x ys -&gt; let eq = eqFromEqDict deq in ...
@
which might usefully be separated to
@
        \deq -&gt; let eq = eqFromEqDict deq in \xy -&gt; ...
@
Well, maybe.  We don't do this at the moment.

Note [Join points]
~~~~~~~~~~~~~~~~~~
Every occurrence of a join point must be a tail call (see Note [Invariants on
join points] in GHC.Core), so we must be careful with how far we float them. The
mechanism for doing so is the *join ceiling*, detailed in Note [Join ceiling]
in GHC.Core.Opt.SetLevels. For us, the significance is that a binder might be marked to be
dropped at the nearest boundary between tail calls and non-tail calls. For
example:

  (&lt; join j = ... in
     let x = &lt; ... &gt; in
     case &lt; ... &gt; of
       A -&gt; ...
       B -&gt; ...
   &gt;) &lt; ... &gt; &lt; ... &gt;

Here the join ceilings are marked with angle brackets. Either side of an
application is a join ceiling, as is the scrutinee position of a case
expression or the RHS of a let binding (but not a join point).

Why do we *want* do float join points at all? After all, they're never
allocated, so there's no sharing to be gained by floating them. However, the
other benefit of floating is making RHSes small, and this can have a significant
impact. In particular, stream fusion has been known to produce nested loops like
this:

  joinrec j1 x1 =
    joinrec j2 x2 =
      joinrec j3 x3 = ... jump j1 (x3 + 1) ... jump j2 (x3 + 1) ...
      in jump j3 x2
    in jump j2 x1
  in jump j1 x

(Assume x1 and x2 do *not* occur free in j3.)

Here j1 and j2 are wholly superfluous---each of them merely forwards its
argument to j3. Since j3 only refers to x3, we can float j2 and j3 to make
everything one big mutual recursion:

  joinrec j1 x1 = jump j2 x1
          j2 x2 = jump j3 x2
          j3 x3 = ... jump j1 (x3 + 1) ... jump j2 (x3 + 1) ...
  in jump j1 x

Now the simplifier will happily inline the trivial j1 and j2, leaving only j3.
Without floating, we're stuck with three loops instead of one.

************************************************************************
*                                                                      *
\subsection[floatOutwards]{@floatOutwards@: let-floating interface function}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatOutwards"><span class="hs-identifier hs-type">floatOutwards</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#FloatOutSwitches"><span class="hs-identifier hs-type">FloatOutSwitches</span></a></span><span>
</span><span id="line-166"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-167"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span>
</span><span id="line-168"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span id="floatOutwards"><span class="annot"><span class="annottext">floatOutwards :: FloatOutSwitches
-&gt; DynFlags -&gt; UniqSupply -&gt; [CoreBind] -&gt; IO [CoreBind]
</span><a href="GHC.Core.Opt.FloatOut.html#floatOutwards"><span class="hs-identifier hs-var hs-var">floatOutwards</span></a></span></span><span> </span><span id="local-6989586621680968275"><span class="annot"><span class="annottext">FloatOutSwitches
</span><a href="#local-6989586621680968275"><span class="hs-identifier hs-var">float_sws</span></a></span></span><span> </span><span id="local-6989586621680968274"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680968274"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680968273"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680968273"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621680968272"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968272"><span class="hs-identifier hs-var">pgm</span></a></span></span><span>
</span><span id="line-171"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-172"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680968271"><span class="annot"><span class="annottext">annotated_w_levels :: [LevelledBind]
</span><a href="#local-6989586621680968271"><span class="hs-identifier hs-var hs-var">annotated_w_levels</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches -&gt; [CoreBind] -&gt; UniqSupply -&gt; [LevelledBind]
</span><a href="GHC.Core.Opt.SetLevels.html#setLevels"><span class="hs-identifier hs-var">setLevels</span></a></span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches
</span><a href="#local-6989586621680968275"><span class="hs-identifier hs-var">float_sws</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968272"><span class="hs-identifier hs-var">pgm</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680968273"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-173"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621680968269"><span class="annot"><span class="annottext">[FloatStats]
</span><a href="#local-6989586621680968269"><span class="hs-identifier hs-var">fss</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968268"><span class="annot"><span class="annottext">[Bag CoreBind]
</span><a href="#local-6989586621680968268"><span class="hs-identifier hs-var">binds_s'</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(FloatStats, Bag CoreBind)] -&gt; ([FloatStats], [Bag CoreBind])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LevelledBind -&gt; (FloatStats, Bag CoreBind))
-&gt; [LevelledBind] -&gt; [(FloatStats, Bag CoreBind)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LevelledBind -&gt; (FloatStats, Bag CoreBind)
</span><a href="GHC.Core.Opt.FloatOut.html#floatTopBind"><span class="hs-identifier hs-var">floatTopBind</span></a></span><span> </span><span class="annot"><span class="annottext">[LevelledBind]
</span><a href="#local-6989586621680968271"><span class="hs-identifier hs-var">annotated_w_levels</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>            </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680968274"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_verbose_core2core"><span class="hs-identifier hs-var">Opt_D_verbose_core2core</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Levels added:&quot;</span></span><span>
</span><span id="line-177"></span><span>                  </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatCore"><span class="hs-identifier hs-var">FormatCore</span></a></span><span>
</span><span id="line-178"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LevelledBind -&gt; SDoc) -&gt; [LevelledBind] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LevelledBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[LevelledBind]
</span><a href="#local-6989586621680968271"><span class="hs-identifier hs-var">annotated_w_levels</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">;</span><span>
</span><span id="line-179"></span><span>
</span><span id="line-180"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968261"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968261"><span class="hs-identifier hs-var">tlets</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968260"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968260"><span class="hs-identifier hs-var">ntlets</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968259"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968259"><span class="hs-identifier hs-var">lams</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatStats -&gt; (Int, Int, Int)
</span><a href="GHC.Core.Opt.FloatOut.html#get_stats"><span class="hs-identifier hs-var">get_stats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FloatStats] -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#sum_stats"><span class="hs-identifier hs-var">sum_stats</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatStats]
</span><a href="#local-6989586621680968269"><span class="hs-identifier hs-var">fss</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">;</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680968274"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl_stats"><span class="hs-identifier hs-var">Opt_D_dump_simpl_stats</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;FloatOut stats:&quot;</span></span><span>
</span><span id="line-183"></span><span>                </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatText"><span class="hs-identifier hs-var">FormatText</span></a></span><span>
</span><span id="line-184"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hcat"><span class="hs-identifier hs-var">hcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968261"><span class="hs-identifier hs-var">tlets</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; Lets floated to top level; &quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-185"></span><span>                        </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968260"><span class="hs-identifier hs-var">ntlets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; Lets floated elsewhere; from &quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-186"></span><span>                        </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968259"><span class="hs-identifier hs-var">lams</span></a></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; Lambda groups&quot;</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">;</span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span>        </span><span class="annot"><span class="annottext">[CoreBind] -&gt; IO [CoreBind]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag CoreBind -&gt; [CoreBind]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Bag CoreBind] -&gt; Bag CoreBind
forall a. [Bag a] -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionManyBags"><span class="hs-identifier hs-var">unionManyBags</span></a></span><span> </span><span class="annot"><span class="annottext">[Bag CoreBind]
</span><a href="#local-6989586621680968268"><span class="hs-identifier hs-var">binds_s'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatTopBind"><span class="hs-identifier hs-type">floatTopBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledBind"><span class="hs-identifier hs-type">LevelledBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span id="floatTopBind"><span class="annot"><span class="annottext">floatTopBind :: LevelledBind -&gt; (FloatStats, Bag CoreBind)
</span><a href="GHC.Core.Opt.FloatOut.html#floatTopBind"><span class="hs-identifier hs-var hs-var">floatTopBind</span></a></span></span><span> </span><span id="local-6989586621680968249"><span class="annot"><span class="annottext">LevelledBind
</span><a href="#local-6989586621680968249"><span class="hs-identifier hs-var">bind</span></a></span></span><span>
</span><span id="line-193"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LevelledBind -&gt; (FloatStats, FloatBinds, [CoreBind])
</span><a href="GHC.Core.Opt.FloatOut.html#floatBind"><span class="hs-identifier hs-var">floatBind</span></a></span><span> </span><span class="annot"><span class="annottext">LevelledBind
</span><a href="#local-6989586621680968249"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968247"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968247"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968246"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968246"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968245"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968245"><span class="hs-identifier hs-var">bind'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680968244"><span class="annot"><span class="annottext">float_bag :: Bag CoreBind
</span><a href="#local-6989586621680968244"><span class="hs-identifier hs-var hs-var">float_bag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; Bag CoreBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenTopFloats"><span class="hs-identifier hs-var">flattenTopFloats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968246"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-195"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968245"><span class="hs-identifier hs-var">bind'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-196"></span><span>      </span><span class="hs-comment">-- bind' can't have unlifted values or join points, so can only be one</span><span>
</span><span id="line-197"></span><span>      </span><span class="hs-comment">-- value bind, rec or non-rec (see comment on floatBind)</span><span>
</span><span id="line-198"></span><span>      </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621680968241"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968241"><span class="hs-identifier hs-var">prs</span></a></span></span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968247"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; Bag CoreBind
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag CoreBind -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
</span><a href="GHC.Core.Opt.FloatOut.html#addTopFloatPairs"><span class="hs-identifier hs-var">addTopFloatPairs</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680968244"><span class="hs-identifier hs-var">float_bag</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968241"><span class="hs-identifier hs-var">prs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>      </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621680968237"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968237"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680968236"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968236"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968247"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680968244"><span class="hs-identifier hs-var">float_bag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; CoreBind -&gt; Bag CoreBind
forall a. Bag a -&gt; a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#snocBag"><span class="hs-operator hs-var">`snocBag`</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Expr Id -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968237"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968236"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>      </span><span class="annot"><span class="annottext">[CoreBind]
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (FloatStats, Bag CoreBind)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;floatTopBind&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreBind] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968245"><span class="hs-identifier hs-var">bind'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection[FloatOut-Bind]{Floating in a binding (the business end)}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatBind"><span class="hs-identifier hs-type">floatBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledBind"><span class="hs-identifier hs-type">LevelledBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span>  </span><span class="hs-comment">-- Returns a list with either</span><span>
</span><span id="line-212"></span><span>  </span><span class="hs-comment">--   * A single non-recursive binding (value or join point), or</span><span>
</span><span id="line-213"></span><span>  </span><span class="hs-comment">--   * The following, in order:</span><span>
</span><span id="line-214"></span><span>  </span><span class="hs-comment">--     * Zero or more non-rec unlifted bindings</span><span>
</span><span id="line-215"></span><span>  </span><span class="hs-comment">--     * One or both of:</span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-comment">--       * A recursive group of join binds</span><span>
</span><span id="line-217"></span><span>  </span><span class="hs-comment">--       * A recursive group of value binds</span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-comment">-- See Note [Floating out of Rec rhss] for why things get arranged this way.</span><span>
</span><span id="line-219"></span><span id="floatBind"><span class="annot"><span class="annottext">floatBind :: LevelledBind -&gt; (FloatStats, FloatBinds, [CoreBind])
</span><a href="GHC.Core.Opt.FloatOut.html#floatBind"><span class="hs-identifier hs-var hs-var">floatBind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680968232"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968232"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680968231"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968231"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatRhs"><span class="hs-identifier hs-var">floatRhs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968232"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968231"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968229"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968229"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968228"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968228"><span class="hs-identifier hs-var">rhs_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968227"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968227"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span>        </span><span class="hs-comment">-- A tiresome hack:</span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-comment">-- see Note [Bottoming floats: eta expansion] in GHC.Core.Opt.SetLevels</span><span>
</span><span id="line-224"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680968224"><span class="annot"><span class="annottext">rhs'' :: Expr Id
</span><a href="#local-6989586621680968224"><span class="hs-identifier hs-var hs-var">rhs''</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isDeadEndId"><span class="hs-identifier hs-var">isDeadEndId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968232"><span class="hs-identifier hs-var">var</span></a></span><span>
</span><span id="line-225"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Int
</span><a href="GHC.Core.Opt.Arity.html#exprArity"><span class="hs-identifier hs-var">exprArity</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968227"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Int
</span><a href="GHC.Types.Id.html#idArity"><span class="hs-identifier hs-var">idArity</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968232"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.Arity.html#etaExpand"><span class="hs-identifier hs-var">etaExpand</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Int
</span><a href="GHC.Types.Id.html#idArity"><span class="hs-identifier hs-var">idArity</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968232"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968227"><span class="hs-identifier hs-var">rhs'</span></a></span><span>
</span><span id="line-226"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968227"><span class="hs-identifier hs-var">rhs'</span></a></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968229"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968228"><span class="hs-identifier hs-var">rhs_floats</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; Expr Id -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968232"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968224"><span class="hs-identifier hs-var">rhs''</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatBind"><span class="hs-identifier hs-var">floatBind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621680968222"><span class="annot"><span class="annottext">[(TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))]
</span><a href="#local-6989586621680968222"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">((TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))
 -&gt; (FloatStats, FloatBinds, ([(Id, Expr Id)], [(Id, Expr Id)])))
-&gt; [(TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))]
-&gt; (FloatStats, FloatBinds, [([(Id, Expr Id)], [(Id, Expr Id)])])
forall a b.
(a -&gt; (FloatStats, FloatBinds, b))
-&gt; [a] -&gt; (FloatStats, FloatBinds, [b])
</span><a href="GHC.Core.Opt.FloatOut.html#floatList"><span class="hs-identifier hs-var">floatList</span></a></span><span> </span><span class="annot"><span class="annottext">(TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))
-&gt; (FloatStats, FloatBinds, ([(Id, Expr Id)], [(Id, Expr Id)]))
</span><a href="#local-6989586621680968220"><span class="hs-identifier hs-var">do_pair</span></a></span><span> </span><span class="annot"><span class="annottext">[(TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))]
</span><a href="#local-6989586621680968222"><span class="hs-identifier hs-var">pairs</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968219"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968219"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968218"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968218"><span class="hs-identifier hs-var">rhs_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968217"><span class="annot"><span class="annottext">[([(Id, Expr Id)], [(Id, Expr Id)])]
</span><a href="#local-6989586621680968217"><span class="hs-identifier hs-var">new_pairs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-232"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968216"><span class="annot"><span class="annottext">[[(Id, Expr Id)]]
</span><a href="#local-6989586621680968216"><span class="hs-identifier hs-var">new_ul_pairss</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968215"><span class="annot"><span class="annottext">[[(Id, Expr Id)]]
</span><a href="#local-6989586621680968215"><span class="hs-identifier hs-var">new_other_pairss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[([(Id, Expr Id)], [(Id, Expr Id)])]
-&gt; ([[(Id, Expr Id)]], [[(Id, Expr Id)]])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[([(Id, Expr Id)], [(Id, Expr Id)])]
</span><a href="#local-6989586621680968217"><span class="hs-identifier hs-var">new_pairs</span></a></span><span>
</span><span id="line-233"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621680968213"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968213"><span class="hs-identifier hs-var">new_join_pairs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968212"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968212"><span class="hs-identifier hs-var">new_l_pairs</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Id, Expr Id) -&gt; Bool)
-&gt; [(Id, Expr Id)] -&gt; ([(Id, Expr Id)], [(Id, Expr Id)])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isJoinId"><span class="hs-identifier hs-var">isJoinId</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; ((Id, Expr Id) -&gt; Id) -&gt; (Id, Expr Id) -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, Expr Id) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>                                                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[(Id, Expr Id)]] -&gt; [(Id, Expr Id)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[(Id, Expr Id)]]
</span><a href="#local-6989586621680968215"><span class="hs-identifier hs-var">new_other_pairss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span>        </span><span class="hs-comment">-- Can't put the join points and the values in the same rec group</span><span>
</span><span id="line-236"></span><span>        </span><span id="local-6989586621680968207"><span class="annot"><span class="annottext">new_rec_binds :: [CoreBind]
</span><a href="#local-6989586621680968207"><span class="hs-identifier hs-var hs-var">new_rec_binds</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968213"><span class="hs-identifier hs-var">new_join_pairs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968212"><span class="hs-identifier hs-var">new_l_pairs</span></a></span><span>    </span><span class="hs-special">]</span><span>
</span><span id="line-237"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968212"><span class="hs-identifier hs-var">new_l_pairs</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968213"><span class="hs-identifier hs-var">new_join_pairs</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-238"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968212"><span class="hs-identifier hs-var">new_l_pairs</span></a></span><span>
</span><span id="line-239"></span><span>                                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968213"><span class="hs-identifier hs-var">new_join_pairs</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-240"></span><span>        </span><span id="local-6989586621680968204"><span class="annot"><span class="annottext">new_non_rec_binds :: [CoreBind]
</span><a href="#local-6989586621680968204"><span class="hs-identifier hs-var hs-var">new_non_rec_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Expr Id -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968203"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968202"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968203"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968203"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968202"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968202"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[(Id, Expr Id)]] -&gt; [(Id, Expr Id)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[(Id, Expr Id)]]
</span><a href="#local-6989586621680968216"><span class="hs-identifier hs-var">new_ul_pairss</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-242"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968219"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968218"><span class="hs-identifier hs-var">rhs_floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968204"><span class="hs-identifier hs-var">new_non_rec_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; [CoreBind] -&gt; [CoreBind]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968207"><span class="hs-identifier hs-var">new_rec_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-244"></span><span>    </span><span class="annot"><a href="#local-6989586621680968220"><span class="hs-identifier hs-type">do_pair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledBndr"><span class="hs-identifier hs-type">LevelledBndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledExpr"><span class="hs-identifier hs-type">LevelledExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-245"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-246"></span><span>                </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- Non-recursive unlifted value bindings</span><span>
</span><span id="line-247"></span><span>                 </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Join points and lifted value bindings</span><span>
</span><span id="line-248"></span><span>    </span><span id="local-6989586621680968220"><span class="annot"><span class="annottext">do_pair :: (TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))
-&gt; (FloatStats, FloatBinds, ([(Id, Expr Id)], [(Id, Expr Id)]))
</span><a href="#local-6989586621680968220"><span class="hs-identifier hs-var hs-var">do_pair</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680968198"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968198"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680968197"><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968197"><span class="hs-identifier hs-var">spec</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968196"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968196"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Level -&gt; Bool
</span><a href="GHC.Core.Opt.SetLevels.html#isTopLvl"><span class="hs-identifier hs-var">isTopLvl</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968194"><span class="hs-identifier hs-var">dest_lvl</span></a></span><span>  </span><span class="hs-comment">-- See Note [floatBind for top level]</span><span>
</span><span id="line-250"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatRhs"><span class="hs-identifier hs-var">floatRhs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968198"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968196"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968193"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968193"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968192"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968192"><span class="hs-identifier hs-var">rhs_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968191"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968191"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968193"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
</span><a href="GHC.Core.Opt.FloatOut.html#addTopFloatPairs"><span class="hs-identifier hs-var">addTopFloatPairs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatBinds -&gt; Bag CoreBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenTopFloats"><span class="hs-identifier hs-var">flattenTopFloats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968192"><span class="hs-identifier hs-var">rhs_floats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-252"></span><span>                                                </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968198"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968191"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-253"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>         </span><span class="hs-comment">-- Note [Floating out of Rec rhss]</span><span>
</span><span id="line-254"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatRhs"><span class="hs-identifier hs-var">floatRhs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968198"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968196"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968189"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968189"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968188"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968188"><span class="hs-identifier hs-var">rhs_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968187"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968187"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-255"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level -&gt; FloatBinds -&gt; (FloatBinds, Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#partitionByLevel"><span class="hs-identifier hs-var">partitionByLevel</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968194"><span class="hs-identifier hs-var">dest_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968188"><span class="hs-identifier hs-var">rhs_floats</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968185"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968185"><span class="hs-identifier hs-var">rhs_floats'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968184"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968184"><span class="hs-identifier hs-var">heres</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-256"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind -&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#splitRecFloats"><span class="hs-identifier hs-var">splitRecFloats</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968184"><span class="hs-identifier hs-var">heres</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968182"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968182"><span class="hs-identifier hs-var">ul_pairs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968181"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968181"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968180"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968180"><span class="hs-identifier hs-var">case_heres</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-257"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680968179"><span class="annot"><span class="annottext">pairs' :: [(Id, Expr Id)]
</span><a href="#local-6989586621680968179"><span class="hs-identifier hs-var hs-var">pairs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968198"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.FloatOut.html#installUnderLambdas"><span class="hs-identifier hs-var">installUnderLambdas</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968180"><span class="hs-identifier hs-var">case_heres</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968187"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Id, Expr Id) -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968181"><span class="hs-identifier hs-var">pairs</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-258"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968189"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968185"><span class="hs-identifier hs-var">rhs_floats'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968182"><span class="hs-identifier hs-var">ul_pairs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968179"><span class="hs-identifier hs-var">pairs'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-259"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-260"></span><span>        </span><span id="local-6989586621680968194"><span class="annot"><span class="annottext">dest_lvl :: Level
</span><a href="#local-6989586621680968194"><span class="hs-identifier hs-var hs-var">dest_lvl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatSpec -&gt; Level
</span><a href="GHC.Core.Opt.SetLevels.html#floatSpecLevel"><span class="hs-identifier hs-var">floatSpecLevel</span></a></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968197"><span class="hs-identifier hs-var">spec</span></a></span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#splitRecFloats"><span class="hs-identifier hs-type">splitRecFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span>
</span><span id="line-263"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- Non-recursive unlifted value bindings</span><span>
</span><span id="line-264"></span><span>                   </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- Join points and lifted value bindings</span><span>
</span><span id="line-265"></span><span>                   </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- A tail of further bindings</span><span>
</span><span id="line-266"></span><span class="hs-comment">-- The &quot;tail&quot; begins with a case</span><span>
</span><span id="line-267"></span><span class="hs-comment">-- See Note [Floating out of Rec rhss]</span><span>
</span><span id="line-268"></span><span id="splitRecFloats"><span class="annot"><span class="annottext">splitRecFloats :: Bag FloatBind -&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#splitRecFloats"><span class="hs-identifier hs-var hs-var">splitRecFloats</span></a></span></span><span> </span><span id="local-6989586621680968176"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968176"><span class="hs-identifier hs-var">fs</span></a></span></span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
-&gt; [(Id, Expr Id)]
-&gt; [FloatBind]
-&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="#local-6989586621680968175"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind -&gt; [FloatBind]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968176"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-271"></span><span>    </span><span id="local-6989586621680968175"><span class="annot"><span class="annottext">go :: [(Id, Expr Id)]
-&gt; [(Id, Expr Id)]
-&gt; [FloatBind]
-&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="#local-6989586621680968175"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680968172"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968172"><span class="hs-identifier hs-var">ul_prs</span></a></span></span><span> </span><span id="local-6989586621680968171"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968171"><span class="hs-identifier hs-var">prs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621680968169"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968169"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680968168"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968168"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680968167"><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968167"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Bool
Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnliftedType"><span class="hs-identifier hs-var">isUnliftedType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968169"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-272"></span><span>                                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isJoinId"><span class="hs-identifier hs-var">isJoinId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968169"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-273"></span><span>                                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
-&gt; [(Id, Expr Id)]
-&gt; [FloatBind]
-&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="#local-6989586621680968175"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968169"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968168"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(Id, Expr Id) -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968172"><span class="hs-identifier hs-var">ul_prs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968171"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968167"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-274"></span><span>                                               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-275"></span><span>                                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
-&gt; [(Id, Expr Id)]
-&gt; [FloatBind]
-&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="#local-6989586621680968175"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968172"><span class="hs-identifier hs-var">ul_prs</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968169"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968168"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(Id, Expr Id) -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968171"><span class="hs-identifier hs-var">prs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968167"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-276"></span><span>    </span><span class="annot"><a href="#local-6989586621680968175"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680968164"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968164"><span class="hs-identifier hs-var">ul_prs</span></a></span></span><span> </span><span id="local-6989586621680968163"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968163"><span class="hs-identifier hs-var">prs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621680968162"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968162"><span class="hs-identifier hs-var">prs'</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680968161"><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968161"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
-&gt; [(Id, Expr Id)]
-&gt; [FloatBind]
-&gt; ([(Id, Expr Id)], [(Id, Expr Id)], Bag FloatBind)
</span><a href="#local-6989586621680968175"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968164"><span class="hs-identifier hs-var">ul_prs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968162"><span class="hs-identifier hs-var">prs'</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968163"><span class="hs-identifier hs-var">prs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968161"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-277"></span><span>    </span><span class="annot"><a href="#local-6989586621680968175"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680968160"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968160"><span class="hs-identifier hs-var">ul_prs</span></a></span></span><span> </span><span id="local-6989586621680968159"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968159"><span class="hs-identifier hs-var">prs</span></a></span></span><span> </span><span id="local-6989586621680968158"><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968158"><span class="hs-identifier hs-var">fs</span></a></span></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968160"><span class="hs-identifier hs-var">ul_prs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680968159"><span class="hs-identifier hs-var">prs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-278"></span><span>                                                  </span><span class="annot"><span class="annottext">[FloatBind] -&gt; Bag FloatBind
forall a. [a] -&gt; Bag a
</span><a href="GHC.Data.Bag.html#listToBag"><span class="hs-identifier hs-var">listToBag</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatBind]
</span><a href="#local-6989586621680968158"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span>                                                   </span><span class="hs-comment">-- Order only matters for</span><span>
</span><span id="line-280"></span><span>                                                   </span><span class="hs-comment">-- non-rec</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#installUnderLambdas"><span class="hs-identifier hs-type">installUnderLambdas</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-283"></span><span class="hs-comment">-- Note [Floating out of Rec rhss]</span><span>
</span><span id="line-284"></span><span id="installUnderLambdas"><span class="annot"><span class="annottext">installUnderLambdas :: Bag FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.FloatOut.html#installUnderLambdas"><span class="hs-identifier hs-var hs-var">installUnderLambdas</span></a></span></span><span> </span><span id="local-6989586621680968155"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968155"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621680968154"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968154"><span class="hs-identifier hs-var">e</span></a></span></span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bool
forall a. Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#isEmptyBag"><span class="hs-identifier hs-var">isEmptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968155"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968154"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-286"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680968152"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968154"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-287"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-288"></span><span>    </span><span id="local-6989586621680968152"><span class="annot"><span class="annottext">go :: Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680968152"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span id="local-6989586621680968150"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968150"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680968149"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968149"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Expr Id -&gt; Expr Id
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968150"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680968152"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968149"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>    </span><span class="annot"><a href="#local-6989586621680968152"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680968148"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968148"><span class="hs-identifier hs-var">e</span></a></span></span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.FloatOut.html#install"><span class="hs-identifier hs-var">install</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968155"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968148"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-292"></span><span id="local-6989586621680968417"><span id="local-6989586621680968418"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatList"><span class="hs-identifier hs-type">floatList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680968418"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621680968417"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680968418"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621680968417"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span></span><span>
</span><span id="line-293"></span><span id="floatList"><span class="annot"><span class="annottext">floatList :: forall a b.
(a -&gt; (FloatStats, FloatBinds, b))
-&gt; [a] -&gt; (FloatStats, FloatBinds, [b])
</span><a href="GHC.Core.Opt.FloatOut.html#floatList"><span class="hs-identifier hs-var hs-var">floatList</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; (FloatStats, FloatBinds, b)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var">zeroStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatList"><span class="hs-identifier hs-var">floatList</span></a></span><span> </span><span id="local-6989586621680968145"><span class="annot"><span class="annottext">a -&gt; (FloatStats, FloatBinds, b)
</span><a href="#local-6989586621680968145"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968144"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680968144"><span class="hs-identifier hs-var">a</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680968143"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680968143"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (FloatStats, FloatBinds, b)
</span><a href="#local-6989586621680968145"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680968144"><span class="hs-identifier hs-var">a</span></a></span><span>            </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968142"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968142"><span class="hs-identifier hs-var">fs_a</span></a></span></span><span class="hs-special">,</span><span>  </span><span id="local-6989586621680968141"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968141"><span class="hs-identifier hs-var">binds_a</span></a></span></span><span class="hs-special">,</span><span>  </span><span id="local-6989586621680968140"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680968140"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-295"></span><span>                     </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(a -&gt; (FloatStats, FloatBinds, b))
-&gt; [a] -&gt; (FloatStats, FloatBinds, [b])
forall a b.
(a -&gt; (FloatStats, FloatBinds, b))
-&gt; [a] -&gt; (FloatStats, FloatBinds, [b])
</span><a href="GHC.Core.Opt.FloatOut.html#floatList"><span class="hs-identifier hs-var">floatList</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; (FloatStats, FloatBinds, b)
</span><a href="#local-6989586621680968145"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680968143"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968139"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968139"><span class="hs-identifier hs-var">fs_as</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968138"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968138"><span class="hs-identifier hs-var">binds_as</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968137"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621680968137"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-296"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968142"><span class="hs-identifier hs-var">fs_a</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-operator hs-var">`add_stats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968139"><span class="hs-identifier hs-var">fs_as</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968141"><span class="hs-identifier hs-var">binds_a</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span>  </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968138"><span class="hs-identifier hs-var">binds_as</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680968140"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; [b]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621680968137"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span class="hs-comment">{-
Note [Floating out of Rec rhss]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider   Rec { f&lt;1,0&gt; = \xy. body }
From the body we may get some floats. The ones with level &lt;1,0&gt; must
stay here, since they may mention f.  Ideally we'd like to make them
part of the Rec block pairs -- but we can't if there are any
FloatCases involved.

Nor is it a good idea to dump them in the rhs, but outside the lambda
    f = case x of I# y -&gt; \xy. body
because now f's arity might get worse, which is Not Good. (And if
there's an SCC around the RHS it might not get better again.
See #5342.)

So, gruesomely, we split the floats into
 * the outer FloatLets, which can join the Rec, and
 * an inner batch starting in a FloatCase, which are then
   pushed *inside* the lambdas.
This loses full-laziness the rare situation where there is a
FloatCase and a Rec interacting.

If there are unlifted FloatLets (that *aren't* join points) among the floats,
we can't add them to the recursive group without angering Core Lint, but since
they must be ok-for-speculation, they can't actually be making any recursive
calls, so we can safely pull them out and keep them non-recursive.

(Why is something getting floated to &lt;1,0&gt; that doesn't make a recursive call?
The case that came up in testing was that f *and* the unlifted binding were
getting floated *to the same place*:

  \x&lt;2,0&gt; -&gt;
    ... &lt;3,0&gt;
    letrec { f&lt;F&lt;2,0&gt;&gt; =
      ... let x'&lt;F&lt;2,0&gt;&gt; = x +# 1# in ...
    } in ...

Everything gets labeled &quot;float to &lt;2,0&gt;&quot; because it all depends on x, but this
makes f and x' look mutually recursive when they're not.

The test was shootout/k-nucleotide, as compiled using commit 47d5dd68 on the
wip/join-points branch.

TODO: This can probably be solved somehow in GHC.Core.Opt.SetLevels. The difference between
&quot;this *is at* level &lt;2,0&gt;&quot; and &quot;this *depends on* level &lt;2,0&gt;&quot; is very
important.)

Note [floatBind for top level]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We may have a *nested* binding whose destination level is (FloatMe tOP_LEVEL), thus
         letrec { foo &lt;0,0&gt; = .... (let bar&lt;0,0&gt; = .. in ..) .... }
The binding for bar will be in the &quot;tops&quot; part of the floating binds,
and thus not partioned by floatBody.

We could perhaps get rid of the 'tops' component of the floating binds,
but this case works just as well.


************************************************************************

\subsection[FloatOut-Expr]{Floating in expressions}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatBody"><span class="hs-identifier hs-type">floatBody</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span>
</span><span id="line-364"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledExpr"><span class="hs-identifier hs-type">LevelledExpr</span></a></span><span>
</span><span id="line-365"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span id="floatBody"><span class="annot"><span class="annottext">floatBody :: Level
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatBody"><span class="hs-identifier hs-var hs-var">floatBody</span></a></span></span><span> </span><span id="local-6989586621680968133"><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968133"><span class="hs-identifier hs-var">lvl</span></a></span></span><span> </span><span id="local-6989586621680968132"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968132"><span class="hs-identifier hs-var">arg</span></a></span></span><span>       </span><span class="hs-comment">-- Used rec rhss, and case-alternative rhss</span><span>
</span><span id="line-368"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968132"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968130"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968130"><span class="hs-identifier hs-var">fsa</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968129"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968129"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968128"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968128"><span class="hs-identifier hs-var">arg'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-369"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level -&gt; FloatBinds -&gt; (FloatBinds, Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#partitionByLevel"><span class="hs-identifier hs-var">partitionByLevel</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968133"><span class="hs-identifier hs-var">lvl</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968129"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968127"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968127"><span class="hs-identifier hs-var">floats'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968126"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968126"><span class="hs-identifier hs-var">heres</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-370"></span><span>        </span><span class="hs-comment">-- Dump bindings are bound here</span><span>
</span><span id="line-371"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968130"><span class="hs-identifier hs-var">fsa</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968127"><span class="hs-identifier hs-var">floats'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.FloatOut.html#install"><span class="hs-identifier hs-var">install</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680968126"><span class="hs-identifier hs-var">heres</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968128"><span class="hs-identifier hs-var">arg'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span class="hs-comment">{- Note [Floating past breakpoints]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We used to disallow floating out of breakpoint ticks (see #10052). However, I
think this is too restrictive.

Consider the case of an expression scoped over by a breakpoint tick,

  tick&lt;...&gt; (let x = ... in f x)

In this case it is completely legal to float out x, despite the fact that
breakpoint ticks are scoped,

  let x = ... in (tick&lt;...&gt;  f x)

The reason here is that we know that the breakpoint will still be hit when the
expression is entered since the tick still scopes over the RHS.

-}</span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-type">floatExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledExpr"><span class="hs-identifier hs-type">LevelledExpr</span></a></span><span>
</span><span id="line-396"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span id="floatExpr"><span class="annot"><span class="annottext">floatExpr :: Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var hs-var">floatExpr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680968124"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968124"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var">zeroStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Expr Id
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968124"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-398"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621680968122"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680968122"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var">zeroStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Expr Id
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680968122"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-399"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span id="local-6989586621680968120"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680968120"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var">zeroStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; Expr Id
forall b. Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-var">Coercion</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680968120"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680968118"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680968118"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var">zeroStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Expr Id
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680968118"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-identifier hs-type">App</span></a></span><span> </span><span id="local-6989586621680968116"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968116"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680968115"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968115"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span>  </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968116"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968113"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968113"><span class="hs-identifier hs-var">fse</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968112"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968112"><span class="hs-identifier hs-var">floats_e</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968111"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968111"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-404"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span>  </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968115"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968110"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968110"><span class="hs-identifier hs-var">fsa</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968109"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968109"><span class="hs-identifier hs-var">floats_a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968108"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968108"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-405"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968113"><span class="hs-identifier hs-var">fse</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-operator hs-var">`add_stats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968110"><span class="hs-identifier hs-var">fsa</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968112"><span class="hs-identifier hs-var">floats_e</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968109"><span class="hs-identifier hs-var">floats_a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Expr Id -&gt; Expr Id
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968111"><span class="hs-identifier hs-var">e'</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968108"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span id="local-6989586621680968107"><span class="annot"><span class="annottext">lam :: Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968107"><span class="hs-identifier hs-var">lam</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680968106"><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968106"><span class="hs-identifier hs-var">lam_spec</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968105"><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680968105"><span class="hs-identifier hs-var">bndrs_w_lvls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968104"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968104"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
-&gt; ([TaggedBndr FloatSpec], Expr (TaggedBndr FloatSpec))
forall b. Expr b -&gt; ([b], Expr b)
</span><a href="GHC.Core.html#collectBinders"><span class="hs-identifier hs-var">collectBinders</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968107"><span class="hs-identifier hs-var">lam</span></a></span><span>
</span><span id="line-409"></span><span>        </span><span id="local-6989586621680968102"><span class="annot"><span class="annottext">bndrs :: [Id]
</span><a href="#local-6989586621680968102"><span class="hs-identifier hs-var hs-var">bndrs</span></a></span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968101"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680968101"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968101"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680968105"><span class="hs-identifier hs-var">bndrs_w_lvls</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-410"></span><span>        </span><span id="local-6989586621680968100"><span class="annot"><span class="annottext">bndr_lvl :: Level
</span><a href="#local-6989586621680968100"><span class="hs-identifier hs-var hs-var">bndr_lvl</span></a></span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Level -&gt; Level
</span><a href="GHC.Core.Opt.SetLevels.html#asJoinCeilLvl"><span class="hs-identifier hs-var">asJoinCeilLvl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatSpec -&gt; Level
</span><a href="GHC.Core.Opt.SetLevels.html#floatSpecLevel"><span class="hs-identifier hs-var">floatSpecLevel</span></a></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968106"><span class="hs-identifier hs-var">lam_spec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-411"></span><span>        </span><span class="hs-comment">-- All the binders have the same level</span><span>
</span><span id="line-412"></span><span>        </span><span class="hs-comment">-- See GHC.Core.Opt.SetLevels.lvlLamBndrs</span><span>
</span><span id="line-413"></span><span>        </span><span class="hs-comment">-- Use asJoinCeilLvl to make this the join ceiling</span><span>
</span><span id="line-414"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-415"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatBody"><span class="hs-identifier hs-var">floatBody</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968100"><span class="hs-identifier hs-var">bndr_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968104"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968098"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968098"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968097"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968097"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968096"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968096"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-416"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats -&gt; FloatBinds -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_to_stats"><span class="hs-identifier hs-var">add_to_stats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968098"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968097"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968097"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Expr Id -&gt; Expr Id
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680968102"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968096"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span id="local-6989586621680968092"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span></span><span> </span><span id="local-6989586621680968091"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968091"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; TickishScoping -&gt; Bool
forall id. Tickish id -&gt; TickishScoping -&gt; Bool
</span><a href="GHC.Core.html#tickishScopesLike"><span class="hs-operator hs-var">`tickishScopesLike`</span></a></span><span> </span><span class="annot"><span class="annottext">TickishScoping
</span><a href="GHC.Core.html#SoftScope"><span class="hs-identifier hs-var">SoftScope</span></a></span><span> </span><span class="hs-comment">-- not scoped, can just float</span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968091"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968088"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968088"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968087"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968087"><span class="hs-identifier hs-var">floating_defns</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968086"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968086"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-421"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968088"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968087"><span class="hs-identifier hs-var">floating_defns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Expr Id -&gt; Expr Id
forall b. Tickish Id -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-var">Tick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968086"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-422"></span><span>
</span><span id="line-423"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; Bool
forall id. Tickish id -&gt; Bool
</span><a href="GHC.Core.html#tickishCounts"><span class="hs-identifier hs-var">tickishCounts</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Bool
forall id. Tickish id -&gt; Bool
</span><a href="GHC.Core.html#tickishCanSplit"><span class="hs-identifier hs-var">tickishCanSplit</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968091"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968082"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968082"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968081"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968081"><span class="hs-identifier hs-var">floating_defns</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968080"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968080"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-425"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- Annotate bindings floated outwards past an scc expression</span><span>
</span><span id="line-426"></span><span>        </span><span class="hs-comment">-- with the cc.  We mark that cc as &quot;duplicated&quot;, though.</span><span>
</span><span id="line-427"></span><span>        </span><span id="local-6989586621680968079"><span class="annot"><span class="annottext">annotated_defns :: FloatBinds
</span><a href="#local-6989586621680968079"><span class="hs-identifier hs-var hs-var">annotated_defns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#wrapTick"><span class="hs-identifier hs-var">wrapTick</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; Tickish Id
forall id. Tickish id -&gt; Tickish id
</span><a href="GHC.Core.html#mkNoCount"><span class="hs-identifier hs-var">mkNoCount</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968081"><span class="hs-identifier hs-var">floating_defns</span></a></span><span>
</span><span id="line-428"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-429"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968082"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968079"><span class="hs-identifier hs-var">annotated_defns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Expr Id -&gt; Expr Id
forall b. Tickish Id -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-var">Tick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968080"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span>  </span><span class="hs-comment">-- Note [Floating past breakpoints]</span><span>
</span><span id="line-432"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#Breakpoint"><span class="hs-identifier hs-type">Breakpoint</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span>
</span><span id="line-433"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968091"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968075"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968075"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968074"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968074"><span class="hs-identifier hs-var">floating_defns</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968073"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968073"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-434"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968075"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968074"><span class="hs-identifier hs-var">floating_defns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Expr Id -&gt; Expr Id
forall b. Tickish Id -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-var">Tick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968073"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-435"></span><span>
</span><span id="line-436"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-437"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (FloatStats, FloatBinds, Expr Id)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;floatExpr tick&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680968092"><span class="hs-identifier hs-var">tickish</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-type">Cast</span></a></span><span> </span><span id="local-6989586621680968071"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968071"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621680968070"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680968070"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968071"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968069"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968069"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968068"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968068"><span class="hs-identifier hs-var">floating_defns</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968067"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968067"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-441"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968069"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968068"><span class="hs-identifier hs-var">floating_defns</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Coercion -&gt; Expr Id
forall b. Expr b -&gt; Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-var">Cast</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968067"><span class="hs-identifier hs-var">expr'</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680968070"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Let"><span class="hs-identifier hs-type">Let</span></a></span><span> </span><span id="local-6989586621680968065"><span class="annot"><span class="annottext">LevelledBind
</span><a href="#local-6989586621680968065"><span class="hs-identifier hs-var">bind</span></a></span></span><span> </span><span id="local-6989586621680968064"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968064"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968063"><span class="hs-identifier hs-var">bind_spec</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-445"></span><span>      </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#FloatMe"><span class="hs-identifier hs-type">FloatMe</span></a></span><span> </span><span id="local-6989586621680968061"><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968061"><span class="hs-identifier hs-var">dest_lvl</span></a></span></span><span>
</span><span id="line-446"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LevelledBind -&gt; (FloatStats, FloatBinds, [CoreBind])
</span><a href="GHC.Core.Opt.FloatOut.html#floatBind"><span class="hs-identifier hs-var">floatBind</span></a></span><span> </span><span class="annot"><span class="annottext">LevelledBind
</span><a href="#local-6989586621680968065"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968060"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968060"><span class="hs-identifier hs-var">fsb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968059"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968059"><span class="hs-identifier hs-var">bind_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968058"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968058"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-447"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968064"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968057"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968057"><span class="hs-identifier hs-var">fse</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968056"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968056"><span class="hs-identifier hs-var">body_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968055"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968055"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-448"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680968053"><span class="annot"><span class="annottext">new_bind_floats :: FloatBinds
</span><a href="#local-6989586621680968053"><span class="hs-identifier hs-var hs-var">new_bind_floats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatBinds -&gt; FloatBinds -&gt; FloatBinds)
-&gt; FloatBinds -&gt; [FloatBinds] -&gt; FloatBinds
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-identifier hs-var">plusFloats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span>
</span><span id="line-449"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreBind -&gt; FloatBinds) -&gt; [CoreBind] -&gt; [FloatBinds]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level -&gt; CoreBind -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#unitLetFloat"><span class="hs-identifier hs-var">unitLetFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968061"><span class="hs-identifier hs-var">dest_lvl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968058"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-450"></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-var">add_stats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968060"><span class="hs-identifier hs-var">fsb</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968057"><span class="hs-identifier hs-var">fse</span></a></span><span>
</span><span id="line-451"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968059"><span class="hs-identifier hs-var">bind_floats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968053"><span class="hs-identifier hs-var">new_bind_floats</span></a></span><span>
</span><span id="line-452"></span><span>                         </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968056"><span class="hs-identifier hs-var">body_floats</span></a></span><span>
</span><span id="line-453"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968055"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-454"></span><span>
</span><span id="line-455"></span><span>      </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#StayPut"><span class="hs-identifier hs-type">StayPut</span></a></span><span> </span><span id="local-6989586621680968049"><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968049"><span class="hs-identifier hs-var">bind_lvl</span></a></span></span><span>  </span><span class="hs-comment">-- See Note [Avoiding unnecessary floating]</span><span>
</span><span id="line-456"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LevelledBind -&gt; (FloatStats, FloatBinds, [CoreBind])
</span><a href="GHC.Core.Opt.FloatOut.html#floatBind"><span class="hs-identifier hs-var">floatBind</span></a></span><span> </span><span class="annot"><span class="annottext">LevelledBind
</span><a href="#local-6989586621680968065"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>          </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968048"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968048"><span class="hs-identifier hs-var">fsb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968047"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968047"><span class="hs-identifier hs-var">bind_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968046"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968046"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-457"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatBody"><span class="hs-identifier hs-var">floatBody</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968049"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968064"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968045"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968045"><span class="hs-identifier hs-var">fse</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968044"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968044"><span class="hs-identifier hs-var">body_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968043"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968043"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-458"></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-var">add_stats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968048"><span class="hs-identifier hs-var">fsb</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968045"><span class="hs-identifier hs-var">fse</span></a></span><span>
</span><span id="line-459"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968047"><span class="hs-identifier hs-var">bind_floats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968044"><span class="hs-identifier hs-var">body_floats</span></a></span><span>
</span><span id="line-460"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(CoreBind -&gt; Expr Id -&gt; Expr Id)
-&gt; Expr Id -&gt; [CoreBind] -&gt; Expr Id
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; Expr Id -&gt; Expr Id
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968043"><span class="hs-identifier hs-var">body'</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621680968046"><span class="hs-identifier hs-var">binds'</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-461"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-462"></span><span>    </span><span id="local-6989586621680968063"><span class="annot"><span class="annottext">bind_spec :: FloatSpec
</span><a href="#local-6989586621680968063"><span class="hs-identifier hs-var hs-var">bind_spec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LevelledBind
</span><a href="#local-6989586621680968065"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-463"></span><span>                 </span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680968042"><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968042"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968042"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-464"></span><span>                 </span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680968041"><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968041"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[(TaggedBndr FloatSpec, Expr (TaggedBndr FloatSpec))]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968041"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-465"></span><span>                 </span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; FloatSpec
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;floatExpr:rec&quot;</span></span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Case"><span class="hs-identifier hs-type">Case</span></a></span><span> </span><span id="local-6989586621680968038"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968038"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680968037"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968037"><span class="hs-identifier hs-var">case_bndr</span></a></span></span><span> </span><span id="local-6989586621680968036"><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968036"><span class="hs-identifier hs-var">case_spec</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680968035"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680968035"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680968034"><span class="annot"><span class="annottext">[Alt (TaggedBndr FloatSpec)]
</span><a href="#local-6989586621680968034"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680968036"><span class="hs-identifier hs-var">case_spec</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-469"></span><span>      </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#FloatMe"><span class="hs-identifier hs-type">FloatMe</span></a></span><span> </span><span id="local-6989586621680968033"><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968033"><span class="hs-identifier hs-var">dest_lvl</span></a></span></span><span>  </span><span class="hs-comment">-- Case expression moves</span><span>
</span><span id="line-470"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621680968032"><span class="annot"><span class="annottext">con :: AltCon
</span><a href="#local-6989586621680968032"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-type">DataAlt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968030"><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680968030"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968029"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968029"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Alt (TaggedBndr FloatSpec)]
</span><a href="#local-6989586621680968034"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-471"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968038"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968028"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968028"><span class="hs-identifier hs-var">fse</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968027"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968027"><span class="hs-identifier hs-var">fde</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968026"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968026"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-472"></span><span>           </span><span class="hs-keyword">case</span><span>                 </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968029"><span class="hs-identifier hs-var">rhs</span></a></span><span>   </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968025"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968025"><span class="hs-identifier hs-var">fsb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968024"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968024"><span class="hs-identifier hs-var">fdb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968023"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968023"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-473"></span><span>           </span><span class="hs-keyword">let</span><span>
</span><span id="line-474"></span><span>             </span><span id="local-6989586621680968022"><span class="annot"><span class="annottext">float :: FloatBinds
</span><a href="#local-6989586621680968022"><span class="hs-identifier hs-var hs-var">float</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Level -&gt; Expr Id -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#unitCaseFloat"><span class="hs-identifier hs-var">unitCaseFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968033"><span class="hs-identifier hs-var">dest_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968026"><span class="hs-identifier hs-var">scrut'</span></a></span><span>
</span><span id="line-475"></span><span>                          </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968037"><span class="hs-identifier hs-var">case_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680968032"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968020"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680968020"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968020"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680968030"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-476"></span><span>           </span><span class="hs-keyword">in</span><span>
</span><span id="line-477"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-var">add_stats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968028"><span class="hs-identifier hs-var">fse</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968025"><span class="hs-identifier hs-var">fsb</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968027"><span class="hs-identifier hs-var">fde</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968022"><span class="hs-identifier hs-var">float</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968024"><span class="hs-identifier hs-var">fdb</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968023"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-478"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-479"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (FloatStats, FloatBinds, Expr Id)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Floating multi-case&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Alt (TaggedBndr FloatSpec)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Alt (TaggedBndr FloatSpec)]
</span><a href="#local-6989586621680968034"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-480"></span><span>
</span><span id="line-481"></span><span>      </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#StayPut"><span class="hs-identifier hs-type">StayPut</span></a></span><span> </span><span id="local-6989586621680968019"><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968019"><span class="hs-identifier hs-var">bind_lvl</span></a></span></span><span>  </span><span class="hs-comment">-- Case expression stays put</span><span>
</span><span id="line-482"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968038"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968018"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968018"><span class="hs-identifier hs-var">fse</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968017"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968017"><span class="hs-identifier hs-var">fde</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968016"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968016"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-483"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(Alt (TaggedBndr FloatSpec)
 -&gt; (FloatStats, FloatBinds, (AltCon, [Id], Expr Id)))
-&gt; [Alt (TaggedBndr FloatSpec)]
-&gt; (FloatStats, FloatBinds, [(AltCon, [Id], Expr Id)])
forall a b.
(a -&gt; (FloatStats, FloatBinds, b))
-&gt; [a] -&gt; (FloatStats, FloatBinds, [b])
</span><a href="GHC.Core.Opt.FloatOut.html#floatList"><span class="hs-identifier hs-var">floatList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level
-&gt; Alt (TaggedBndr FloatSpec)
-&gt; (FloatStats, FloatBinds, (AltCon, [Id], Expr Id))
forall {a} {t}.
Level
-&gt; (a, [TaggedBndr t], Expr (TaggedBndr FloatSpec))
-&gt; (FloatStats, FloatBinds, (a, [Id], Expr Id))
</span><a href="#local-6989586621680968015"><span class="hs-identifier hs-var">float_alt</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968019"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Alt (TaggedBndr FloatSpec)]
</span><a href="#local-6989586621680968034"><span class="hs-identifier hs-var">alts</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968014"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968014"><span class="hs-identifier hs-var">fsa</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968013"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968013"><span class="hs-identifier hs-var">fda</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968012"><span class="annot"><span class="annottext">[(AltCon, [Id], Expr Id)]
</span><a href="#local-6989586621680968012"><span class="hs-identifier hs-var">alts'</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-484"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-var">add_stats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968018"><span class="hs-identifier hs-var">fse</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968014"><span class="hs-identifier hs-var">fsa</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968013"><span class="hs-identifier hs-var">fda</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-operator hs-var">`plusFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968017"><span class="hs-identifier hs-var">fde</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Id -&gt; Type -&gt; [(AltCon, [Id], Expr Id)] -&gt; Expr Id
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968016"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968037"><span class="hs-identifier hs-var">case_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680968035"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], Expr Id)]
</span><a href="#local-6989586621680968012"><span class="hs-identifier hs-var">alts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>           </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-487"></span><span>    </span><span id="local-6989586621680968015"><span class="annot"><span class="annottext">float_alt :: Level
-&gt; (a, [TaggedBndr t], Expr (TaggedBndr FloatSpec))
-&gt; (FloatStats, FloatBinds, (a, [Id], Expr Id))
</span><a href="#local-6989586621680968015"><span class="hs-identifier hs-var hs-var">float_alt</span></a></span></span><span> </span><span id="local-6989586621680968011"><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968011"><span class="hs-identifier hs-var">bind_lvl</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968010"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680968010"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968009"><span class="annot"><span class="annottext">[TaggedBndr t]
</span><a href="#local-6989586621680968009"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968008"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968008"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Level
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatBody"><span class="hs-identifier hs-var">floatBody</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680968011"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968008"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680968007"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968007"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968006"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968006"><span class="hs-identifier hs-var">rhs_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680968005"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968005"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-489"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680968007"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680968006"><span class="hs-identifier hs-var">rhs_floats</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680968010"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968004"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680968004"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968004"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">t
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TaggedBndr t]
</span><a href="#local-6989586621680968009"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680968005"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatRhs"><span class="hs-identifier hs-type">floatRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBndr"><span class="hs-identifier hs-type">CoreBndr</span></a></span><span>
</span><span id="line-492"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#LevelledExpr"><span class="hs-identifier hs-type">LevelledExpr</span></a></span><span>
</span><span id="line-493"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span id="floatRhs"><span class="annot"><span class="annottext">floatRhs :: Id
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatRhs"><span class="hs-identifier hs-var hs-var">floatRhs</span></a></span></span><span> </span><span id="local-6989586621680968002"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968002"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680968001"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968001"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-495"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680968000"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968000"><span class="hs-identifier hs-var">join_arity</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe Int
</span><a href="GHC.Types.Id.html#isJoinId_maybe"><span class="hs-identifier hs-var">isJoinId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680968002"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-496"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680967999"><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680967999"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967998"><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680967998"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; Expr (TaggedBndr FloatSpec)
-&gt; [TaggedBndr FloatSpec]
-&gt; Maybe ([TaggedBndr FloatSpec], Expr (TaggedBndr FloatSpec))
forall {t} {a}.
(Eq t, Num t) =&gt;
t -&gt; Expr a -&gt; [a] -&gt; Maybe ([a], Expr a)
</span><a href="#local-6989586621680967997"><span class="hs-identifier hs-var">try_collect</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680968000"><span class="hs-identifier hs-var">join_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968001"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-497"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680967999"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-498"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968001"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-499"></span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680967996"><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680967996"><span class="hs-identifier hs-var">lam_spec</span></a></span></span><span class="hs-special">)</span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-500"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680967995"><span class="annot"><span class="annottext">lvl :: Level
</span><a href="#local-6989586621680967995"><span class="hs-identifier hs-var hs-var">lvl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatSpec -&gt; Level
</span><a href="GHC.Core.Opt.SetLevels.html#floatSpecLevel"><span class="hs-identifier hs-var">floatSpecLevel</span></a></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><a href="#local-6989586621680967996"><span class="hs-identifier hs-var">lam_spec</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-501"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Level
-&gt; Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatBody"><span class="hs-identifier hs-var">floatBody</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680967995"><span class="hs-identifier hs-var">lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680967998"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680967994"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680967994"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967993"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680967993"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967992"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967992"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-502"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680967994"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680967993"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Expr Id -&gt; Expr Id
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967991"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#TB"><span class="hs-identifier hs-type">TB</span></a></span><span> </span><span id="local-6989586621680967991"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967991"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">FloatSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TaggedBndr FloatSpec]
</span><a href="#local-6989586621680967999"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967992"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-503"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-504"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var">atJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">((FloatStats, FloatBinds, Expr Id)
 -&gt; (FloatStats, FloatBinds, Expr Id))
-&gt; (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec) -&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#floatExpr"><span class="hs-identifier hs-var">floatExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Expr (TaggedBndr FloatSpec)
</span><a href="#local-6989586621680968001"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-505"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-506"></span><span>    </span><span id="local-6989586621680967997"><span class="annot"><span class="annottext">try_collect :: t -&gt; Expr a -&gt; [a] -&gt; Maybe ([a], Expr a)
</span><a href="#local-6989586621680967997"><span class="hs-identifier hs-var hs-var">try_collect</span></a></span></span><span> </span><span class="annot"><span class="annottext">t
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621680967984"><span class="annot"><span class="annottext">Expr a
</span><a href="#local-6989586621680967984"><span class="hs-identifier hs-var">expr</span></a></span></span><span>      </span><span id="local-6989586621680967983"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680967983"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a], Expr a) -&gt; Maybe ([a], Expr a)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680967983"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Expr a
</span><a href="#local-6989586621680967984"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-507"></span><span>    </span><span class="annot"><a href="#local-6989586621680967997"><span class="hs-identifier hs-var">try_collect</span></a></span><span> </span><span id="local-6989586621680967982"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621680967982"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span id="local-6989586621680967981"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680967981"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680967980"><span class="annot"><span class="annottext">Expr a
</span><a href="#local-6989586621680967980"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680967979"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680967979"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t -&gt; Expr a -&gt; [a] -&gt; Maybe ([a], Expr a)
</span><a href="#local-6989586621680967997"><span class="hs-identifier hs-var">try_collect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621680967982"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">t -&gt; t -&gt; t
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">t
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Expr a
</span><a href="#local-6989586621680967980"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680967981"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680967979"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-508"></span><span>    </span><span class="annot"><a href="#local-6989586621680967997"><span class="hs-identifier hs-var">try_collect</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Expr a
</span><span class="hs-identifier">_</span></span><span>         </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([a], Expr a)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-509"></span><span>
</span><span id="line-510"></span><span class="hs-comment">{-
Note [Avoiding unnecessary floating]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In general we want to avoid floating a let unnecessarily, because
it might worsen strictness:
    let
       x = ...(let y = e in y+y)....
Here y is demanded.  If we float it outside the lazy 'x=..' then
we'd have to zap its demand info, and it may never be restored.

So at a 'let' we leave the binding right where the are unless
the binding will escape a value lambda, e.g.

(\x -&gt; let y = fac 100 in y)

That's what the partitionByMajorLevel does in the floatExpr (Let ...)
case.

Notice, though, that we must take care to drop any bindings
from the body of the let that depend on the staying-put bindings.

We used instead to do the partitionByMajorLevel on the RHS of an '=',
in floatRhs.  But that was quite tiresome.  We needed to test for
values or trivial rhss, because (in particular) we don't want to insert
new bindings between the &quot;=&quot; and the &quot;\&quot;.  E.g.
        f = \x -&gt; let &lt;bind&gt; in &lt;body&gt;
We do not want
        f = let &lt;bind&gt; in \x -&gt; &lt;body&gt;
(a) The simplifier will immediately float it further out, so we may
        as well do so right now; in general, keeping rhss as manifest
        values is good
(b) If a float-in pass follows immediately, it might add yet more
        bindings just after the '='.  And some of them might (correctly)
        be strict even though the 'let f' is lazy, because f, being a value,
        gets its demand-info zapped by the simplifier.
And even all that turned out to be very fragile, and broke
altogether when profiling got in the way.

So now we do the partition right at the (Let..) itself.

************************************************************************
*                                                                      *
\subsection{Utility bits for floating stats}
*                                                                      *
************************************************************************

I didn't implement this with unboxed numbers.  I don't want to be too
strict in this stuff, as it is rarely turned on.  (WDP 95/09)
-}</span><span>
</span><span id="line-559"></span><span>
</span><span id="line-560"></span><span class="hs-keyword">data</span><span> </span><span id="FloatStats"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-var">FloatStats</span></a></span></span><span>
</span><span id="line-561"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="FlS"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-var">FlS</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- Number of top-floats * lambda groups they've been past</span><span>
</span><span id="line-562"></span><span>        </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- Number of non-top-floats * lambda groups they've been past</span><span>
</span><span id="line-563"></span><span>        </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>  </span><span class="hs-comment">-- Number of lambda (groups) seen</span><span>
</span><span id="line-564"></span><span>
</span><span id="line-565"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#get_stats"><span class="hs-identifier hs-type">get_stats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-566"></span><span id="get_stats"><span class="annot"><span class="annottext">get_stats :: FloatStats -&gt; (Int, Int, Int)
</span><a href="GHC.Core.Opt.FloatOut.html#get_stats"><span class="hs-identifier hs-var hs-var">get_stats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-type">FlS</span></a></span><span> </span><span id="local-6989586621680967977"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967977"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680967976"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967976"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680967975"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967975"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967977"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967976"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967975"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span>
</span><span id="line-568"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-type">zeroStats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span>
</span><span id="line-569"></span><span id="zeroStats"><span class="annot"><span class="annottext">zeroStats :: FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var hs-var">zeroStats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-var">FlS</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-570"></span><span>
</span><span id="line-571"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#sum_stats"><span class="hs-identifier hs-type">sum_stats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span>
</span><span id="line-572"></span><span id="sum_stats"><span class="annot"><span class="annottext">sum_stats :: [FloatStats] -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#sum_stats"><span class="hs-identifier hs-var hs-var">sum_stats</span></a></span></span><span> </span><span id="local-6989586621680967974"><span class="annot"><span class="annottext">[FloatStats]
</span><a href="#local-6989586621680967974"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatStats -&gt; FloatStats -&gt; FloatStats)
-&gt; FloatStats -&gt; [FloatStats] -&gt; FloatStats
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-var">add_stats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#zeroStats"><span class="hs-identifier hs-var">zeroStats</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatStats]
</span><a href="#local-6989586621680967974"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-573"></span><span>
</span><span id="line-574"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-type">add_stats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span>
</span><span id="line-575"></span><span id="add_stats"><span class="annot"><span class="annottext">add_stats :: FloatStats -&gt; FloatStats -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_stats"><span class="hs-identifier hs-var hs-var">add_stats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-type">FlS</span></a></span><span> </span><span id="local-6989586621680967973"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967973"><span class="hs-identifier hs-var">a1</span></a></span></span><span> </span><span id="local-6989586621680967972"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967972"><span class="hs-identifier hs-var">b1</span></a></span></span><span> </span><span id="local-6989586621680967971"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967971"><span class="hs-identifier hs-var">c1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-type">FlS</span></a></span><span> </span><span id="local-6989586621680967970"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967970"><span class="hs-identifier hs-var">a2</span></a></span></span><span> </span><span id="local-6989586621680967969"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967969"><span class="hs-identifier hs-var">b2</span></a></span></span><span> </span><span id="local-6989586621680967968"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967968"><span class="hs-identifier hs-var">c2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-576"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-var">FlS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967973"><span class="hs-identifier hs-var">a1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967970"><span class="hs-identifier hs-var">a2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967972"><span class="hs-identifier hs-var">b1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967969"><span class="hs-identifier hs-var">b2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967971"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967968"><span class="hs-identifier hs-var">c2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>
</span><span id="line-578"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#add_to_stats"><span class="hs-identifier hs-type">add_to_stats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span>
</span><span id="line-579"></span><span id="add_to_stats"><span class="annot"><span class="annottext">add_to_stats :: FloatStats -&gt; FloatBinds -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#add_to_stats"><span class="hs-identifier hs-var hs-var">add_to_stats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-type">FlS</span></a></span><span> </span><span id="local-6989586621680967966"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967966"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680967965"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967965"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680967964"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967964"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967962"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967962"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621680967961"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967961"><span class="hs-identifier hs-var">ceils</span></a></span></span><span> </span><span id="local-6989586621680967960"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967960"><span class="hs-identifier hs-var">others</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-580"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; FloatStats
</span><a href="GHC.Core.Opt.FloatOut.html#FlS"><span class="hs-identifier hs-var">FlS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967966"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Int
forall a. Bag a -&gt; Int
</span><a href="GHC.Data.Bag.html#lengthBag"><span class="hs-identifier hs-var">lengthBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967962"><span class="hs-identifier hs-var">tops</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-581"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967965"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Int
forall a. Bag a -&gt; Int
</span><a href="GHC.Data.Bag.html#lengthBag"><span class="hs-identifier hs-var">lengthBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967961"><span class="hs-identifier hs-var">ceils</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Int
forall a. Bag a -&gt; Int
</span><a href="GHC.Data.Bag.html#lengthBag"><span class="hs-identifier hs-var">lengthBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MajorEnv -&gt; Bag FloatBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenMajor"><span class="hs-identifier hs-var">flattenMajor</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967960"><span class="hs-identifier hs-var">others</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-582"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967964"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Utility bits for floating}
*                                                                      *
************************************************************************

Note [Representation of FloatBinds]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The FloatBinds types is somewhat important.  We can get very large numbers
of floating bindings, often all destined for the top level.  A typical example
is     x = [4,2,5,2,5, .... ]
Then we get lots of small expressions like (fromInteger 4), which all get
lifted to top level.

The trouble is that
  (a) we partition these floating bindings *at every binding site*
  (b) GHC.Core.Opt.SetLevels introduces a new bindings site for every float
So we had better not look at each binding at each binding site!

That is why MajorEnv is represented as a finite map.

We keep the bindings destined for the *top* level separate, because
we float them out even if they don't escape a *value* lambda; see
partitionByMajorLevel.
-}</span><span>
</span><span id="line-610"></span><span>
</span><span id="line-611"></span><span class="hs-keyword">type</span><span> </span><span id="FloatLet"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span>        </span><span class="hs-comment">-- INVARIANT: a FloatLet is always lifted</span><span>
</span><span id="line-612"></span><span class="hs-keyword">type</span><span> </span><span id="MajorEnv"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MajorEnv"><span class="hs-identifier hs-var">MajorEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.Internal.html#IntMap"><span class="hs-identifier hs-type">M.IntMap</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MinorEnv"><span class="hs-identifier hs-type">MinorEnv</span></a></span><span>         </span><span class="hs-comment">-- Keyed by major level</span><span>
</span><span id="line-613"></span><span class="hs-keyword">type</span><span> </span><span id="MinorEnv"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MinorEnv"><span class="hs-identifier hs-var">MinorEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.Internal.html#IntMap"><span class="hs-identifier hs-type">M.IntMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Keyed by minor level</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span class="hs-keyword">data</span><span> </span><span id="FloatBinds"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-var">FloatBinds</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="FB"><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- Destined for top level</span><span>
</span><span id="line-616"></span><span>                      </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span class="hs-special">)</span><span>          </span><span class="hs-comment">-- Destined for join ceiling</span><span>
</span><span id="line-617"></span><span>                      </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MajorEnv"><span class="hs-identifier hs-type">MajorEnv</span></a></span><span>                 </span><span class="hs-comment">-- Other levels</span><span>
</span><span id="line-618"></span><span>     </span><span class="hs-comment">-- See Note [Representation of FloatBinds]</span><span>
</span><span id="line-619"></span><span>
</span><span id="line-620"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680967953"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-621"></span><span>  </span><span id="local-6989586621680967948"><span class="annot"><span class="annottext">ppr :: FloatBinds -&gt; SDoc
</span><a href="#local-6989586621680967948"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967947"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967947"><span class="hs-identifier hs-var">fbs</span></a></span></span><span> </span><span id="local-6989586621680967946"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967946"><span class="hs-identifier hs-var">ceils</span></a></span></span><span> </span><span id="local-6989586621680967945"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967945"><span class="hs-identifier hs-var">defs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-622"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;FB&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-623"></span><span>           </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tops =&quot;</span></span><span>     </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967947"><span class="hs-identifier hs-var">fbs</span></a></span><span>
</span><span id="line-624"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ceils =&quot;</span></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967946"><span class="hs-identifier hs-var">ceils</span></a></span><span>
</span><span id="line-625"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;non-tops =&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967945"><span class="hs-identifier hs-var">defs</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>
</span><span id="line-627"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#flattenTopFloats"><span class="hs-identifier hs-type">flattenTopFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span>
</span><span id="line-628"></span><span id="flattenTopFloats"><span class="annot"><span class="annottext">flattenTopFloats :: FloatBinds -&gt; Bag CoreBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenTopFloats"><span class="hs-identifier hs-var hs-var">flattenTopFloats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967942"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967942"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621680967941"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967941"><span class="hs-identifier hs-var">ceils</span></a></span></span><span> </span><span id="local-6989586621680967940"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967940"><span class="hs-identifier hs-var">defs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-629"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isEmptyBag</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">flattenMajor</span><span> </span><span class="hs-identifier">defs</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">defs</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-630"></span><span>    </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isEmptyBag</span><span> </span><span class="hs-identifier">ceils</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">ceils</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-631"></span><span>    </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967942"><span class="hs-identifier hs-var">tops</span></a></span><span>
</span><span id="line-632"></span><span>
</span><span id="line-633"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#addTopFloatPairs"><span class="hs-identifier hs-type">addTopFloatPairs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-634"></span><span id="addTopFloatPairs"><span class="annot"><span class="annottext">addTopFloatPairs :: Bag CoreBind -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
</span><a href="GHC.Core.Opt.FloatOut.html#addTopFloatPairs"><span class="hs-identifier hs-var hs-var">addTopFloatPairs</span></a></span></span><span> </span><span id="local-6989586621680967936"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967936"><span class="hs-identifier hs-var">float_bag</span></a></span></span><span> </span><span id="local-6989586621680967935"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680967935"><span class="hs-identifier hs-var">prs</span></a></span></span><span>
</span><span id="line-635"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreBind -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)])
-&gt; [(Id, Expr Id)] -&gt; Bag CoreBind -&gt; [(Id, Expr Id)]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall {a}. Bind a -&gt; [(a, Expr a)] -&gt; [(a, Expr a)]
</span><a href="#local-6989586621680967934"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680967935"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967936"><span class="hs-identifier hs-var">float_bag</span></a></span><span>
</span><span id="line-636"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-637"></span><span>    </span><span id="local-6989586621680967934"><span class="annot"><span class="annottext">add :: Bind a -&gt; [(a, Expr a)] -&gt; [(a, Expr a)]
</span><a href="#local-6989586621680967934"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621680967933"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680967933"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680967932"><span class="annot"><span class="annottext">Expr a
</span><a href="#local-6989586621680967932"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680967931"><span class="annot"><span class="annottext">[(a, Expr a)]
</span><a href="#local-6989586621680967931"><span class="hs-identifier hs-var">prs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680967933"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Expr a
</span><a href="#local-6989586621680967932"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(a, Expr a) -&gt; [(a, Expr a)] -&gt; [(a, Expr a)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(a, Expr a)]
</span><a href="#local-6989586621680967931"><span class="hs-identifier hs-var">prs</span></a></span><span>
</span><span id="line-638"></span><span>    </span><span class="annot"><a href="#local-6989586621680967934"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621680967930"><span class="annot"><span class="annottext">[(a, Expr a)]
</span><a href="#local-6989586621680967930"><span class="hs-identifier hs-var">prs1</span></a></span></span><span class="hs-special">)</span><span>   </span><span id="local-6989586621680967929"><span class="annot"><span class="annottext">[(a, Expr a)]
</span><a href="#local-6989586621680967929"><span class="hs-identifier hs-var">prs2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, Expr a)]
</span><a href="#local-6989586621680967930"><span class="hs-identifier hs-var">prs1</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, Expr a)] -&gt; [(a, Expr a)] -&gt; [(a, Expr a)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, Expr a)]
</span><a href="#local-6989586621680967929"><span class="hs-identifier hs-var">prs2</span></a></span><span>
</span><span id="line-639"></span><span>
</span><span id="line-640"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#flattenMajor"><span class="hs-identifier hs-type">flattenMajor</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MajorEnv"><span class="hs-identifier hs-type">MajorEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span>
</span><span id="line-641"></span><span id="flattenMajor"><span class="annot"><span class="annottext">flattenMajor :: MajorEnv -&gt; Bag FloatBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenMajor"><span class="hs-identifier hs-var hs-var">flattenMajor</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IntMap (Bag FloatBind) -&gt; Bag FloatBind -&gt; Bag FloatBind)
-&gt; Bag FloatBind -&gt; MajorEnv -&gt; Bag FloatBind
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; IntMap a -&gt; b
</span><a href="../../containers/src/Data.IntMap.Internal.html#foldr"><span class="hs-identifier hs-var">M.foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-identifier hs-var">unionBags</span></a></span><span> </span><span class="annot"><span class="annottext">(Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind)
-&gt; (IntMap (Bag FloatBind) -&gt; Bag FloatBind)
-&gt; IntMap (Bag FloatBind)
-&gt; Bag FloatBind
-&gt; Bag FloatBind
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind) -&gt; Bag FloatBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenMinor"><span class="hs-identifier hs-var">flattenMinor</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#flattenMinor"><span class="hs-identifier hs-type">flattenMinor</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MinorEnv"><span class="hs-identifier hs-type">MinorEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span>
</span><span id="line-644"></span><span id="flattenMinor"><span class="annot"><span class="annottext">flattenMinor :: IntMap (Bag FloatBind) -&gt; Bag FloatBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenMinor"><span class="hs-identifier hs-var hs-var">flattenMinor</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind)
-&gt; Bag FloatBind -&gt; IntMap (Bag FloatBind) -&gt; Bag FloatBind
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; IntMap a -&gt; b
</span><a href="../../containers/src/Data.IntMap.Internal.html#foldr"><span class="hs-identifier hs-var">M.foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-identifier hs-var">unionBags</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-type">emptyFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span>
</span><span id="line-647"></span><span id="emptyFloats"><span class="annot"><span class="annottext">emptyFloats :: FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#emptyFloats"><span class="hs-identifier hs-var hs-var">emptyFloats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span>
</span><span id="line-648"></span><span>
</span><span id="line-649"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#unitCaseFloat"><span class="hs-identifier hs-type">unitCaseFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#AltCon"><span class="hs-identifier hs-type">AltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span>
</span><span id="line-650"></span><span id="unitCaseFloat"><span class="annot"><span class="annottext">unitCaseFloat :: Level -&gt; Expr Id -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#unitCaseFloat"><span class="hs-identifier hs-var hs-var">unitCaseFloat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span> </span><span id="local-6989586621680967921"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967921"><span class="hs-identifier hs-var">major</span></a></span></span><span> </span><span id="local-6989586621680967920"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967920"><span class="hs-identifier hs-var">minor</span></a></span></span><span> </span><span id="local-6989586621680967919"><span class="annot"><span class="annottext">LevelType
</span><a href="#local-6989586621680967919"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680967918"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967918"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680967917"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967917"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680967916"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680967916"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680967915"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680967915"><span class="hs-identifier hs-var">bs</span></a></span></span><span>
</span><span id="line-651"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">LevelType
</span><a href="#local-6989586621680967919"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">LevelType -&gt; LevelType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">LevelType
</span><a href="GHC.Core.Opt.SetLevels.html#JoinCeilLvl"><span class="hs-identifier hs-var">JoinCeilLvl</span></a></span><span>
</span><span id="line-652"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967913"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span>
</span><span id="line-653"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-654"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntMap (Bag FloatBind) -&gt; MajorEnv
forall a. Int -&gt; a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#singleton"><span class="hs-identifier hs-var">M.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967921"><span class="hs-identifier hs-var">major</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Bag FloatBind -&gt; IntMap (Bag FloatBind)
forall a. Int -&gt; a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#singleton"><span class="hs-identifier hs-var">M.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967920"><span class="hs-identifier hs-var">minor</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967913"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-655"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-656"></span><span>    </span><span id="local-6989586621680967913"><span class="annot"><span class="annottext">floats :: Bag FloatBind
</span><a href="#local-6989586621680967913"><span class="hs-identifier hs-var hs-var">floats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatBind -&gt; Bag FloatBind
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr Id -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; FloatBind
</span><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967918"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967917"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680967916"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680967915"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-657"></span><span>
</span><span id="line-658"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#unitLetFloat"><span class="hs-identifier hs-type">unitLetFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span>
</span><span id="line-659"></span><span id="unitLetFloat"><span class="annot"><span class="annottext">unitLetFloat :: Level -&gt; CoreBind -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#unitLetFloat"><span class="hs-identifier hs-var hs-var">unitLetFloat</span></a></span></span><span> </span><span id="local-6989586621680967910"><span class="annot"><span class="annottext">lvl :: Level
</span><a href="#local-6989586621680967910"><span class="hs-identifier hs-var">lvl</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span> </span><span id="local-6989586621680967909"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967909"><span class="hs-identifier hs-var">major</span></a></span></span><span> </span><span id="local-6989586621680967908"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967908"><span class="hs-identifier hs-var">minor</span></a></span></span><span> </span><span id="local-6989586621680967907"><span class="annot"><span class="annottext">LevelType
</span><a href="#local-6989586621680967907"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680967906"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680967906"><span class="hs-identifier hs-var">b</span></a></span></span><span>
</span><span id="line-660"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Level -&gt; Bool
</span><a href="GHC.Core.Opt.SetLevels.html#isTopLvl"><span class="hs-identifier hs-var">isTopLvl</span></a></span><span> </span><span class="annot"><span class="annottext">Level
</span><a href="#local-6989586621680967910"><span class="hs-identifier hs-var">lvl</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreBind -&gt; Bag CoreBind
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680967906"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span>
</span><span id="line-661"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">LevelType
</span><a href="#local-6989586621680967907"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">LevelType -&gt; LevelType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">LevelType
</span><a href="GHC.Core.Opt.SetLevels.html#JoinCeilLvl"><span class="hs-identifier hs-var">JoinCeilLvl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967905"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span>
</span><span id="line-662"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntMap (Bag FloatBind) -&gt; MajorEnv
forall a. Int -&gt; a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#singleton"><span class="hs-identifier hs-var">M.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967909"><span class="hs-identifier hs-var">major</span></a></span><span>
</span><span id="line-663"></span><span>                                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Bag FloatBind -&gt; IntMap (Bag FloatBind)
forall a. Int -&gt; a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#singleton"><span class="hs-identifier hs-var">M.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967908"><span class="hs-identifier hs-var">minor</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967905"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-664"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-665"></span><span>    </span><span id="local-6989586621680967905"><span class="annot"><span class="annottext">floats :: Bag FloatBind
</span><a href="#local-6989586621680967905"><span class="hs-identifier hs-var hs-var">floats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatBind -&gt; Bag FloatBind
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreBind -&gt; FloatBind
</span><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680967906"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-666"></span><span>
</span><span id="line-667"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-identifier hs-type">plusFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span>
</span><span id="line-668"></span><span id="plusFloats"><span class="annot"><span class="annottext">plusFloats :: FloatBinds -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#plusFloats"><span class="hs-identifier hs-var hs-var">plusFloats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967904"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967904"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621680967903"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967903"><span class="hs-identifier hs-var">c1</span></a></span></span><span> </span><span id="local-6989586621680967902"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967902"><span class="hs-identifier hs-var">l1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967901"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967901"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span id="local-6989586621680967900"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967900"><span class="hs-identifier hs-var">c2</span></a></span></span><span> </span><span id="local-6989586621680967899"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967899"><span class="hs-identifier hs-var">l2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-669"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967904"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag CoreBind -&gt; Bag CoreBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967901"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967903"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967900"><span class="hs-identifier hs-var">c2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967902"><span class="hs-identifier hs-var">l1</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv -&gt; MajorEnv -&gt; MajorEnv
</span><a href="GHC.Core.Opt.FloatOut.html#plusMajor"><span class="hs-operator hs-var">`plusMajor`</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967899"><span class="hs-identifier hs-var">l2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-670"></span><span>
</span><span id="line-671"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#plusMajor"><span class="hs-identifier hs-type">plusMajor</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MajorEnv"><span class="hs-identifier hs-type">MajorEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MajorEnv"><span class="hs-identifier hs-type">MajorEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MajorEnv"><span class="hs-identifier hs-type">MajorEnv</span></a></span><span>
</span><span id="line-672"></span><span id="plusMajor"><span class="annot"><span class="annottext">plusMajor :: MajorEnv -&gt; MajorEnv -&gt; MajorEnv
</span><a href="GHC.Core.Opt.FloatOut.html#plusMajor"><span class="hs-identifier hs-var hs-var">plusMajor</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IntMap (Bag FloatBind)
 -&gt; IntMap (Bag FloatBind) -&gt; IntMap (Bag FloatBind))
-&gt; MajorEnv -&gt; MajorEnv -&gt; MajorEnv
forall a. (a -&gt; a -&gt; a) -&gt; IntMap a -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#unionWith"><span class="hs-identifier hs-var">M.unionWith</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
-&gt; IntMap (Bag FloatBind) -&gt; IntMap (Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#plusMinor"><span class="hs-identifier hs-var">plusMinor</span></a></span><span>
</span><span id="line-673"></span><span>
</span><span id="line-674"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#plusMinor"><span class="hs-identifier hs-type">plusMinor</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MinorEnv"><span class="hs-identifier hs-type">MinorEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MinorEnv"><span class="hs-identifier hs-type">MinorEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#MinorEnv"><span class="hs-identifier hs-type">MinorEnv</span></a></span><span>
</span><span id="line-675"></span><span id="plusMinor"><span class="annot"><span class="annottext">plusMinor :: IntMap (Bag FloatBind)
-&gt; IntMap (Bag FloatBind) -&gt; IntMap (Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#plusMinor"><span class="hs-identifier hs-var hs-var">plusMinor</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind)
-&gt; IntMap (Bag FloatBind)
-&gt; IntMap (Bag FloatBind)
-&gt; IntMap (Bag FloatBind)
forall a. (a -&gt; a -&gt; a) -&gt; IntMap a -&gt; IntMap a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#unionWith"><span class="hs-identifier hs-var">M.unionWith</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-identifier hs-var">unionBags</span></a></span><span>
</span><span id="line-676"></span><span>
</span><span id="line-677"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#install"><span class="hs-identifier hs-type">install</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-678"></span><span id="install"><span class="annot"><span class="annottext">install :: Bag FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.FloatOut.html#install"><span class="hs-identifier hs-var hs-var">install</span></a></span></span><span> </span><span id="local-6989586621680967895"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967895"><span class="hs-identifier hs-var">defn_groups</span></a></span></span><span> </span><span id="local-6989586621680967894"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967894"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-679"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatBind -&gt; Expr Id -&gt; Expr Id)
-&gt; Expr Id -&gt; Bag FloatBind -&gt; Expr Id
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Make.html#wrapFloat"><span class="hs-identifier hs-var">wrapFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967894"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967895"><span class="hs-identifier hs-var">defn_groups</span></a></span><span>
</span><span id="line-680"></span><span>
</span><span id="line-681"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#partitionByLevel"><span class="hs-identifier hs-type">partitionByLevel</span></a></span><span>
</span><span id="line-682"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span>                </span><span class="hs-comment">-- Partitioning level</span><span>
</span><span id="line-683"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span>           </span><span class="hs-comment">-- Defns to be divided into 2 piles...</span><span>
</span><span id="line-684"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- Defns  with level strictly &lt; partition level,</span><span>
</span><span id="line-685"></span><span>            </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- The rest</span><span>
</span><span id="line-686"></span><span>
</span><span id="line-687"></span><span class="hs-comment">{-
--       ---- partitionByMajorLevel ----
-- Float it if we escape a value lambda,
--     *or* if we get to the top level
--     *or* if it's a case-float and its minor level is &lt; current
--
-- If we can get to the top level, say &quot;yes&quot; anyway. This means that
--      x = f e
-- transforms to
--    lvl = e
--    x = f lvl
-- which is as it should be

partitionByMajorLevel (Level major _) (FB tops defns)
  = (FB tops outer, heres `unionBags` flattenMajor inner)
  where
    (outer, mb_heres, inner) = M.splitLookup major defns
    heres = case mb_heres of
               Nothing -&gt; emptyBag
               Just h  -&gt; flattenMinor h
-}</span><span>
</span><span id="line-708"></span><span>
</span><span id="line-709"></span><span id="partitionByLevel"><span class="annot"><span class="annottext">partitionByLevel :: Level -&gt; FloatBinds -&gt; (FloatBinds, Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#partitionByLevel"><span class="hs-identifier hs-var hs-var">partitionByLevel</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.SetLevels.html#Level"><span class="hs-identifier hs-type">Level</span></a></span><span> </span><span id="local-6989586621680967892"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967892"><span class="hs-identifier hs-var">major</span></a></span></span><span> </span><span id="local-6989586621680967891"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967891"><span class="hs-identifier hs-var">minor</span></a></span></span><span> </span><span id="local-6989586621680967890"><span class="annot"><span class="annottext">LevelType
</span><a href="#local-6989586621680967890"><span class="hs-identifier hs-var">typ</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967889"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967889"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621680967888"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967888"><span class="hs-identifier hs-var">ceils</span></a></span></span><span> </span><span id="local-6989586621680967887"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967887"><span class="hs-identifier hs-var">defns</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-710"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967889"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967886"><span class="hs-identifier hs-var">ceils'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967885"><span class="hs-identifier hs-var">outer_maj</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv -&gt; MajorEnv -&gt; MajorEnv
</span><a href="GHC.Core.Opt.FloatOut.html#plusMajor"><span class="hs-operator hs-var">`plusMajor`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; IntMap (Bag FloatBind) -&gt; MajorEnv
forall a. Int -&gt; a -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#singleton"><span class="hs-identifier hs-var">M.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967892"><span class="hs-identifier hs-var">major</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
</span><a href="#local-6989586621680967884"><span class="hs-identifier hs-var">outer_min</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-711"></span><span>     </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967883"><span class="hs-identifier hs-var">here_min</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967882"><span class="hs-identifier hs-var">here_ceil</span></a></span><span>
</span><span id="line-712"></span><span>              </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind) -&gt; Bag FloatBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenMinor"><span class="hs-identifier hs-var">flattenMinor</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
</span><a href="#local-6989586621680967881"><span class="hs-identifier hs-var">inner_min</span></a></span><span>
</span><span id="line-713"></span><span>              </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv -&gt; Bag FloatBind
</span><a href="GHC.Core.Opt.FloatOut.html#flattenMajor"><span class="hs-identifier hs-var">flattenMajor</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967880"><span class="hs-identifier hs-var">inner_maj</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-714"></span><span>
</span><span id="line-715"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-716"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680967885"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967885"><span class="hs-identifier hs-var">outer_maj</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967879"><span class="annot"><span class="annottext">Maybe (IntMap (Bag FloatBind))
</span><a href="#local-6989586621680967879"><span class="hs-identifier hs-var">mb_here_maj</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967880"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967880"><span class="hs-identifier hs-var">inner_maj</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; MajorEnv -&gt; (MajorEnv, Maybe (IntMap (Bag FloatBind)), MajorEnv)
forall a. Int -&gt; IntMap a -&gt; (IntMap a, Maybe a, IntMap a)
</span><a href="../../containers/src/Data.IntMap.Internal.html#splitLookup"><span class="hs-identifier hs-var">M.splitLookup</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967892"><span class="hs-identifier hs-var">major</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967887"><span class="hs-identifier hs-var">defns</span></a></span><span>
</span><span id="line-717"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680967884"><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
</span><a href="#local-6989586621680967884"><span class="hs-identifier hs-var">outer_min</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967877"><span class="annot"><span class="annottext">Maybe (Bag FloatBind)
</span><a href="#local-6989586621680967877"><span class="hs-identifier hs-var">mb_here_min</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967881"><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
</span><a href="#local-6989586621680967881"><span class="hs-identifier hs-var">inner_min</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (IntMap (Bag FloatBind))
</span><a href="#local-6989586621680967879"><span class="hs-identifier hs-var">mb_here_maj</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-718"></span><span>                                            </span><span class="annot"><span class="annottext">Maybe (IntMap (Bag FloatBind))
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe (Bag FloatBind)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
forall a. IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#empty"><span class="hs-identifier hs-var">M.empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-719"></span><span>                                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680967876"><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
</span><a href="#local-6989586621680967876"><span class="hs-identifier hs-var">min_defns</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; IntMap (Bag FloatBind)
-&gt; (IntMap (Bag FloatBind), Maybe (Bag FloatBind),
    IntMap (Bag FloatBind))
forall a. Int -&gt; IntMap a -&gt; (IntMap a, Maybe a, IntMap a)
</span><a href="../../containers/src/Data.IntMap.Internal.html#splitLookup"><span class="hs-identifier hs-var">M.splitLookup</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680967891"><span class="hs-identifier hs-var">minor</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap (Bag FloatBind)
</span><a href="#local-6989586621680967876"><span class="hs-identifier hs-var">min_defns</span></a></span><span>
</span><span id="line-720"></span><span>    </span><span id="local-6989586621680967883"><span class="annot"><span class="annottext">here_min :: Bag FloatBind
</span><a href="#local-6989586621680967883"><span class="hs-identifier hs-var hs-var">here_min</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Bag FloatBind)
</span><a href="#local-6989586621680967877"><span class="hs-identifier hs-var">mb_here_min</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Bag FloatBind) -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span>
</span><span id="line-721"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680967882"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967882"><span class="hs-identifier hs-var">here_ceil</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967886"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967886"><span class="hs-identifier hs-var">ceils'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">LevelType
</span><a href="#local-6989586621680967890"><span class="hs-identifier hs-var">typ</span></a></span><span> </span><span class="annot"><span class="annottext">LevelType -&gt; LevelType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">LevelType
</span><a href="GHC.Core.Opt.SetLevels.html#JoinCeilLvl"><span class="hs-identifier hs-var">JoinCeilLvl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967888"><span class="hs-identifier hs-var">ceils</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-722"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967888"><span class="hs-identifier hs-var">ceils</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-723"></span><span>
</span><span id="line-724"></span><span class="hs-comment">-- Like partitionByLevel, but instead split out the bindings that are marked</span><span>
</span><span id="line-725"></span><span class="hs-comment">-- to float to the nearest join ceiling (see Note [Join points])</span><span>
</span><span id="line-726"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#partitionAtJoinCeiling"><span class="hs-identifier hs-type">partitionAtJoinCeiling</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier hs-type">FloatBind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-727"></span><span id="partitionAtJoinCeiling"><span class="annot"><span class="annottext">partitionAtJoinCeiling :: FloatBinds -&gt; (FloatBinds, Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#partitionAtJoinCeiling"><span class="hs-identifier hs-var hs-var">partitionAtJoinCeiling</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967872"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967872"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621680967871"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967871"><span class="hs-identifier hs-var">ceils</span></a></span></span><span> </span><span id="local-6989586621680967870"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967870"><span class="hs-identifier hs-var">defs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-728"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967872"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967870"><span class="hs-identifier hs-var">defs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967871"><span class="hs-identifier hs-var">ceils</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-729"></span><span>
</span><span id="line-730"></span><span class="hs-comment">-- Perform some action at a join ceiling, i.e., don't let join points float out</span><span>
</span><span id="line-731"></span><span class="hs-comment">-- (see Note [Join points])</span><span>
</span><span id="line-732"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-type">atJoinCeiling</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-733"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatStats"><span class="hs-identifier hs-type">FloatStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-734"></span><span id="atJoinCeiling"><span class="annot"><span class="annottext">atJoinCeiling :: (FloatStats, FloatBinds, Expr Id)
-&gt; (FloatStats, FloatBinds, Expr Id)
</span><a href="GHC.Core.Opt.FloatOut.html#atJoinCeiling"><span class="hs-identifier hs-var hs-var">atJoinCeiling</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680967869"><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680967869"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967868"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680967868"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967867"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967867"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-735"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatStats
</span><a href="#local-6989586621680967869"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680967866"><span class="hs-identifier hs-var">floats'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Opt.FloatOut.html#install"><span class="hs-identifier hs-var">install</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967865"><span class="hs-identifier hs-var">ceils</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967867"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-736"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-737"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621680967866"><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680967866"><span class="hs-identifier hs-var">floats'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680967865"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967865"><span class="hs-identifier hs-var">ceils</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatBinds -&gt; (FloatBinds, Bag FloatBind)
</span><a href="GHC.Core.Opt.FloatOut.html#partitionAtJoinCeiling"><span class="hs-identifier hs-var">partitionAtJoinCeiling</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBinds
</span><a href="#local-6989586621680967868"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-738"></span><span>
</span><span id="line-739"></span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#wrapTick"><span class="hs-identifier hs-type">wrapTick</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#Tickish"><span class="hs-identifier hs-type">Tickish</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FloatBinds"><span class="hs-identifier hs-type">FloatBinds</span></a></span><span>
</span><span id="line-740"></span><span id="wrapTick"><span class="annot"><span class="annottext">wrapTick :: Tickish Id -&gt; FloatBinds -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#wrapTick"><span class="hs-identifier hs-var hs-var">wrapTick</span></a></span></span><span> </span><span id="local-6989586621680967864"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680967864"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-type">FB</span></a></span><span> </span><span id="local-6989586621680967863"><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967863"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621680967862"><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967862"><span class="hs-identifier hs-var">ceils</span></a></span></span><span> </span><span id="local-6989586621680967861"><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967861"><span class="hs-identifier hs-var">defns</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-741"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag CoreBind -&gt; Bag FloatBind -&gt; MajorEnv -&gt; FloatBinds
</span><a href="GHC.Core.Opt.FloatOut.html#FB"><span class="hs-identifier hs-var">FB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreBind -&gt; CoreBind) -&gt; Bag CoreBind -&gt; Bag CoreBind
forall a b. (a -&gt; b) -&gt; Bag a -&gt; Bag b
</span><a href="GHC.Data.Bag.html#mapBag"><span class="hs-identifier hs-var">mapBag</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreBind
</span><a href="#local-6989586621680967859"><span class="hs-identifier hs-var">wrap_bind</span></a></span><span> </span><span class="annot"><span class="annottext">Bag CoreBind
</span><a href="#local-6989586621680967863"><span class="hs-identifier hs-var">tops</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind
</span><a href="#local-6989586621680967858"><span class="hs-identifier hs-var">wrap_defns</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind
</span><a href="#local-6989586621680967862"><span class="hs-identifier hs-var">ceils</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-742"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(IntMap (Bag FloatBind) -&gt; IntMap (Bag FloatBind))
-&gt; MajorEnv -&gt; MajorEnv
forall a b. (a -&gt; b) -&gt; IntMap a -&gt; IntMap b
</span><a href="../../containers/src/Data.IntMap.Internal.html#map"><span class="hs-identifier hs-var">M.map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Bag FloatBind -&gt; Bag FloatBind)
-&gt; IntMap (Bag FloatBind) -&gt; IntMap (Bag FloatBind)
forall a b. (a -&gt; b) -&gt; IntMap a -&gt; IntMap b
</span><a href="../../containers/src/Data.IntMap.Internal.html#map"><span class="hs-identifier hs-var">M.map</span></a></span><span> </span><span class="annot"><span class="annottext">Bag FloatBind -&gt; Bag FloatBind
</span><a href="#local-6989586621680967858"><span class="hs-identifier hs-var">wrap_defns</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MajorEnv
</span><a href="#local-6989586621680967861"><span class="hs-identifier hs-var">defns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-743"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-744"></span><span>    </span><span id="local-6989586621680967858"><span class="annot"><span class="annottext">wrap_defns :: Bag FloatBind -&gt; Bag FloatBind
</span><a href="#local-6989586621680967858"><span class="hs-identifier hs-var hs-var">wrap_defns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatBind -&gt; FloatBind) -&gt; Bag FloatBind -&gt; Bag FloatBind
forall a b. (a -&gt; b) -&gt; Bag a -&gt; Bag b
</span><a href="GHC.Data.Bag.html#mapBag"><span class="hs-identifier hs-var">mapBag</span></a></span><span> </span><span class="annot"><span class="annottext">FloatBind -&gt; FloatBind
</span><a href="#local-6989586621680967856"><span class="hs-identifier hs-var">wrap_one</span></a></span><span>
</span><span id="line-745"></span><span>
</span><span id="line-746"></span><span>    </span><span id="local-6989586621680967859"><span class="annot"><span class="annottext">wrap_bind :: CoreBind -&gt; CoreBind
</span><a href="#local-6989586621680967859"><span class="hs-identifier hs-var hs-var">wrap_bind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621680967855"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967855"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span id="local-6989586621680967854"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967854"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Expr Id -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967855"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680967853"><span class="hs-identifier hs-var">maybe_tick</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967854"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-747"></span><span>    </span><span class="annot"><a href="#local-6989586621680967859"><span class="hs-identifier hs-var">wrap_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621680967852"><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680967852"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Expr Id -&gt; Expr Id) -&gt; [(Id, Expr Id)] -&gt; [(Id, Expr Id)]
forall b c a. (b -&gt; c) -&gt; [(a, b)] -&gt; [(a, c)]
</span><a href="GHC.Utils.Misc.html#mapSnd"><span class="hs-identifier hs-var">mapSnd</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680967853"><span class="hs-identifier hs-var">maybe_tick</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, Expr Id)]
</span><a href="#local-6989586621680967852"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-748"></span><span>
</span><span id="line-749"></span><span>    </span><span id="local-6989586621680967856"><span class="annot"><span class="annottext">wrap_one :: FloatBind -&gt; FloatBind
</span><a href="#local-6989586621680967856"><span class="hs-identifier hs-var hs-var">wrap_one</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621680967850"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680967850"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; FloatBind
</span><a href="GHC.Core.Make.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreBind -&gt; CoreBind
</span><a href="#local-6989586621680967859"><span class="hs-identifier hs-var">wrap_bind</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621680967850"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-750"></span><span>    </span><span class="annot"><a href="#local-6989586621680967856"><span class="hs-identifier hs-var">wrap_one</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621680967849"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967849"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680967848"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967848"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621680967847"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680967847"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621680967846"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680967846"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; FloatBind
</span><a href="GHC.Core.Make.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680967853"><span class="hs-identifier hs-var">maybe_tick</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967849"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680967848"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680967847"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680967846"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span>    </span><span id="local-6989586621680967853"><span class="annot"><span class="annottext">maybe_tick :: Expr Id -&gt; Expr Id
</span><a href="#local-6989586621680967853"><span class="hs-identifier hs-var hs-var">maybe_tick</span></a></span></span><span> </span><span id="local-6989586621680967845"><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967845"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Expr Id -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprIsHNF"><span class="hs-identifier hs-var">exprIsHNF</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967845"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Utils.html#tickHNFArgs"><span class="hs-identifier hs-var">tickHNFArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680967864"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967845"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-753"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Expr Id -&gt; Expr Id
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680967864"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Expr Id
</span><a href="#local-6989586621680967845"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-754"></span><span>      </span><span class="hs-comment">-- we don't need to wrap a tick around an HNF when we float it</span><span>
</span><span id="line-755"></span><span>      </span><span class="hs-comment">-- outside a tick: that is an invariant of the tick semantics</span><span>
</span><span id="line-756"></span><span>      </span><span class="hs-comment">-- Conversely, inlining of HNFs inside an SCC is allowed, and</span><span>
</span><span id="line-757"></span><span>      </span><span class="hs-comment">-- indeed the HNF we're floating here might well be inlined back</span><span>
</span><span id="line-758"></span><span>      </span><span class="hs-comment">-- again, and we don't want to end up with duplicate ticks.</span><span>
</span><span id="line-759"></span></pre></body></html>